#!/usr/bin/sh

htmlfile=$1

ONAME=`perl -nle 'if($_ =~ /font_org\">(.*)<\/font.*/){print $1}' $htmlfile`
GHS=`perl -nle 'if($_ =~ /(GH.*).html.*nombre_de\">(\d+)<.*/){print $1, "\t", $2}' $htmlfile | awk '{sum += $2}END{print sum}'`
GTS=`perl -nle 'if($_ =~ /(GT.*).html.*nombre_de\">(\d+)<.*/){print $1, "\t", $2}' $htmlfile | awk '{sum += $2}END{print sum}'`
PLS=`perl -nle 'if($_ =~ /(PL.*).html.*nombre_de\">(\d+)<.*/){print $1, "\t", $2}' $htmlfile | awk '{sum += $2}END{print sum}'`
CES=`perl -nle 'if($_ =~ /(CE.*).html.*nombre_de\">(\d+)<.*/){print $1, "\t", $2}' $htmlfile | awk '{sum += $2}END{print sum}'`
CBMS=`perl -nle 'if($_ =~ /(CBM.*).html.*nombre_de\">(\d+)<.*/){print $1, "\t", $2}' $htmlfile | awk '{sum += $2}END{print sum}'`
TOTAL=$((GHS+GTS+PLS+CES+CBMS))

echo $ONAME
echo "GHs=" $GHS
echo "GTs=" $GTS
echo "PLs=" $PLS
echo "CEs=" $CES
echo "CBMs=" $CBMS
echo "Total=" $TOTAL

